package com.huike.xingxing.fragment;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;

import com.huike.xingxing.activity.BaseActivity;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class BaseFragment extends Fragment {

    private Context context;
    private ProgressDialog show;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = getActivity();
    }

    public void showLoading(){
        if(show == null){
            show = ProgressDialog.show(context, "提示", "数据加载中...");
            show.setCancelable(true);
        }
        show.show();
    }
    public void hide(){
        if (show != null && show.isShowing()){
            show.dismiss();
        }
    }



}
